<template>
  <div class="search_history">
    <van-cell title="搜索内容">
      <div v-if="idDeleteShow">
        <span @click="$emit('allDelete')">全部删除</span>
        &nbsp;&nbsp;
        <span @click="idDeleteShow=false">完成</span>
      </div>
      <van-icon
        v-else
        @click="idDeleteShow=true"
        name="delete"
      />
    </van-cell>
    <van-cell
      v-for="(item, index) in searchHistory"
      @click="$emit('selectDelete',index)"
      :key="index"
      :title="item"
      value="内容"
    >
      <van-icon name="clear" />
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'SearchHistory',
  components: {},
  props: {
    searchHistory: {
      type: Array,
      required: true
    }
  },
  data () {
    return {
      idDeleteShow: false
    }
  },
  // 计算属性
  computed: {},
  // 侦听器
  watch: {},
  created () { },
  mounted () { },
  methods: {}
}
</script>

<style scoped lang="less">
</style>
